program D4;

{$APPTYPE CONSOLE}

uses
  SysUtils;
var
  n, k, a, b, i, j, sum1, sum2, sum3 : integer
  mass1, mass2, mass3 : array of integer;
  c : real;

begin
 sum1:=0;
 readln(n);
 readln(k);
 if (n > k) then
 begin
   a := n-k;
 end;

 if (k > n) then
 begin
   a := k-n;
 end;

 Setlength(mass1, n);
 Setlength(mass2, k);
 Setlength(mass3, a);

 for i:=1 to n do
   read(mass1, [i]);

 for j:=1 to k do
   read(mass2, [j]);

 for b:=1 to a do
   read(mass2, [b]);

 for i:=0 to n-1 do
 begin
 sum1 := sum1 + mass[i];
 end;

 for j:=0 to k-1 do
 begin
 sum2 := sum2 + mass[j];
 end;

 for b:=0 to a-1 do
 begin
 sum3 := sum3 + mass[b];
 end;

 c := (sum1 div sum2) div sum3;
 writeln(c);
 readln;

end.



